/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.trabajo.modelo.entidad;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author wilmer noe
 */
@Entity
@Table(name = "provedor")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Provedor.findAll", query = "SELECT p FROM Provedor p"),
    @NamedQuery(name = "Provedor.findByIdProveedor", query = "SELECT p FROM Provedor p WHERE p.idProveedor = :idProveedor"),
    @NamedQuery(name = "Provedor.findByNombre", query = "SELECT p FROM Provedor p WHERE p.nombre = :nombre"),
    @NamedQuery(name = "Provedor.findByNombrec", query = "SELECT p FROM Provedor p WHERE p.nombrec = :nombrec"),
    @NamedQuery(name = "Provedor.findByDireccion", query = "SELECT p FROM Provedor p WHERE p.direccion = :direccion"),
    @NamedQuery(name = "Provedor.findByDistrito", query = "SELECT p FROM Provedor p WHERE p.distrito = :distrito"),
    @NamedQuery(name = "Provedor.findByProvincia", query = "SELECT p FROM Provedor p WHERE p.provincia = :provincia"),
    @NamedQuery(name = "Provedor.findByDepartamento", query = "SELECT p FROM Provedor p WHERE p.departamento = :departamento"),
    @NamedQuery(name = "Provedor.findByCp", query = "SELECT p FROM Provedor p WHERE p.cp = :cp"),
    @NamedQuery(name = "Provedor.findByTel1", query = "SELECT p FROM Provedor p WHERE p.tel1 = :tel1"),
    @NamedQuery(name = "Provedor.findByTel2", query = "SELECT p FROM Provedor p WHERE p.tel2 = :tel2"),
    @NamedQuery(name = "Provedor.findByTel3", query = "SELECT p FROM Provedor p WHERE p.tel3 = :tel3"),
    @NamedQuery(name = "Provedor.findByEmail", query = "SELECT p FROM Provedor p WHERE p.email = :email")})
public class Provedor implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 5)
    @Column(name = "id_proveedor")
    private String idProveedor;
    @Size(max = 60)
    @Column(name = "nombre")
    private String nombre;
    @Size(max = 60)
    @Column(name = "nombrec")
    private String nombrec;
    @Size(max = 30)
    @Column(name = "direccion")
    private String direccion;
    @Size(max = 30)
    @Column(name = "distrito")
    private String distrito;
    @Size(max = 30)
    @Column(name = "provincia")
    private String provincia;
    @Size(max = 30)
    @Column(name = "departamento")
    private String departamento;
    @Size(max = 15)
    @Column(name = "cp")
    private String cp;
    @Size(max = 12)
    @Column(name = "tel1")
    private String tel1;
    @Size(max = 12)
    @Column(name = "tel2")
    private String tel2;
    @Size(max = 12)
    @Column(name = "tel3")
    private String tel3;
    // @Pattern(regexp="[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?", message="Correo electrónico no válido")//if the field contains email address consider using this annotation to enforce field validation
    @Size(max = 20)
    @Column(name = "email")
    private String email;

    public Provedor() {
    }

    public Provedor(String idProveedor) {
        this.idProveedor = idProveedor;
    }

    public String getIdProveedor() {
        return idProveedor;
    }

    public void setIdProveedor(String idProveedor) {
        this.idProveedor = idProveedor;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public String getNombrec() {
        return nombrec;
    }

    public void setNombrec(String nombrec) {
        this.nombrec = nombrec;
    }

    public String getDireccion() {
        return direccion;
    }

    public void setDireccion(String direccion) {
        this.direccion = direccion;
    }

    public String getDistrito() {
        return distrito;
    }

    public void setDistrito(String distrito) {
        this.distrito = distrito;
    }

    public String getProvincia() {
        return provincia;
    }

    public void setProvincia(String provincia) {
        this.provincia = provincia;
    }

    public String getDepartamento() {
        return departamento;
    }

    public void setDepartamento(String departamento) {
        this.departamento = departamento;
    }

    public String getCp() {
        return cp;
    }

    public void setCp(String cp) {
        this.cp = cp;
    }

    public String getTel1() {
        return tel1;
    }

    public void setTel1(String tel1) {
        this.tel1 = tel1;
    }

    public String getTel2() {
        return tel2;
    }

    public void setTel2(String tel2) {
        this.tel2 = tel2;
    }

    public String getTel3() {
        return tel3;
    }

    public void setTel3(String tel3) {
        this.tel3 = tel3;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idProveedor != null ? idProveedor.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Provedor)) {
            return false;
        }
        Provedor other = (Provedor) object;
        if ((this.idProveedor == null && other.idProveedor != null) || (this.idProveedor != null && !this.idProveedor.equals(other.idProveedor))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.trabajo.modelo.entidad.Provedor[ idProveedor=" + idProveedor + " ]";
    }
    
}
